import React, { useMemo } from 'react';
import classes from './index.module.css';
import classnames from 'classnames';

interface BlockButtonInf {
  text: string;
  type?: string;
  onClick?: () => void;
}

export default function BlockButton({ text, type, onClick }: BlockButtonInf) {
  const className = useMemo(() => {
    return classnames(
      classes.BlockButton,
      type === 'primary' ? classes.PrimaryButton : '',
    );
  }, [type]);
  return (
    <button className={className} onClick={onClick}>
      {text}
    </button>
  );
}
